# Contributor: Thomas Boerger <thomas@webhippie.de>
# Maintainer: Thomas Boerger <thomas@webhippie.de>
pkgname=cloudfoundry-cli
pkgver=8.7.9
pkgrel=4
pkgdesc="A CLI for Cloud Foundry written in Go"
url="https://github.com/cloudfoundry/cli"
arch="all !s390x !armv7"
license="Apache-2.0"
makedepends="go bash"
checkdepends="ginkgo"
options="!check" # some tests fail
source="$pkgname-$pkgver.tar.gz::https://github.com/cloudfoundry/cli/archive/v$pkgver.tar.gz
	fix-cgo.patch
	"
builddir="$srcdir/cli-$pkgver"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"

export GOFLAGS="$GOFLAGS -mod=mod -modcacherw"

build() {
	make build GOFLAGS="$GOFLAGS"
}

check() {
	make test GOFLAGS="$GOFLAGS"
}

package() {
	mkdir -p "$pkgdir"/usr/bin
	install -Dm755 out/cf "$pkgdir"/usr/bin/cf
}

sha512sums="
211181ebfbe000ff90e5548ed4881d8d52fb3303438ca6b77b0d9ebc9300ed73f918cb87c9133ad01611c69efab425f5a57a51a8207c5db036d57fa20c8ebcc0  cloudfoundry-cli-8.7.9.tar.gz
da6f16ef0b5aebb12bcac1272ce731debf25c8533df15074d00beff3910fc0c0fe9e3bb1e817333c585fc71844d4b22e7addc1b08a8b131f9ef11fcc5bbe5e1b  fix-cgo.patch
"
